//CollisionsHandler.h - Class Collision Handler

#ifndef _COLLISIONSHANDLER_H_
#define _COLLISIONSHANDLER_H_

#include "Shape.h"
#include "Screen.h"
#include <cmath>
//#include "Rect.h"
//#include "Circle.h"

class Rect;
class Circle;

using namespace std;

class CollisionsHandler
{

private:

	// Rectangle-specific methods
	static int isRectangleInRectangle(const Rect *rect1,const Rect *rect2);
	static void isRecToRecCollisionXandY(const Rect* rect1,const Rect* rect2, bool& colX , bool& colY); // Const functions?

	// Circle-specific methods
	static void isCircToCircCollisionXandY(const Circle* circ1,const Circle* circ2, bool& colX , bool& colY);
    static void whichQuarterInCircle(const Point& point, const Circle& circle, bool& colX , bool& colY);
	static bool isCircleInCircle(const Circle& circle1, const Circle& circle2);
	static void isCircToRecCollisionXandY(const Circle* circ,const Rect* rect, bool& colX , bool& colY);

	static int whoIsFasterHor(const Shape* shape1, const Shape* shape2);
	static int whoIsFasterVer(const Shape* shape1, const Shape* shape2);

public:

	// Static publics for Shape Container
	static void handleCollisions(Circle *circ1, Circle *circ2);
	static void handleCollisions(Circle *circ, Rect *rect);
	static void handleCollisions(Rect *rect, Circle *circ);
	static void handleCollisions(Rect *rect1, Rect *rect2);

	// Rectangle
	static bool isRecCollideWithBorder(const Rect* rect, bool& colX, bool& colY);

	// Circle
	static bool isCircleCollideWithBorder(const Circle* circ, bool& colX, bool& colY);
};

#endif
